package cn.rengy.web.framework.wxmp.jsapi;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.rengy.tpa.wxmp.jsapi.JsApiManager;
import cn.rengy.tpa.wxmp.token.AccessToken;
import cn.rengy.web.framework.wxmp.token.AccessTokenCacheService;
import cn.rengy.web.framework.wxmp.token.JsApiTicketService;
import cn.rengy.web.framework.wxmp.token.TokenService;

@Service
public class JsapiService {
	@Autowired
	private JsApiTicketService jsApiTicketService;
	
	/**
	 * 初始化指定公众号的jsapi
	 * @param appid
	 * @param url
	 * @return
	 * @throws Exception
	 */
	public Object signature(String appid,String url) throws Exception{
		return JsApiManager.signature(url,jsApiTicketService.acquire(appid), appid);
	}
}
